import sys
import os

# 获取项目根目录
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '../..'))
sys.path.insert(0, BASE_DIR)

print(BASE_DIR)

from backend.common.database import db_config

TORTOISE_ORM = {
    "connections": db_config['connections'],
    "apps": {
        "models": {  # ✅ 合规 app 名
            "models": [
                "aerich.models",
                "backend.models.user",
                "backend.models.request_log",
                "backend.models.agent"
            ],
            "default_connection": "default",
        },
    },
}